<template>
  <div class="app-container">
    <div v-if="user">
      <el-row :gutter="20">

        <el-col :span="6" :xs="24">
          <user-card :user="user" />
        </el-col>

        <el-col :span="18" :xs="24">
          <el-card>
            <el-tabs v-model="activeTab">
              <!-- <el-tab-pane label="Activity" name="activity">
                <activity />
              </el-tab-pane> -->
              <el-tab-pane label="天气预报" name="timeline">
                <timeline />
              </el-tab-pane>
              <el-tab-pane label="修改个人资料" name="account">
                <account :user="user" />
              </el-tab-pane>
            </el-tabs>
          </el-card>
        </el-col>

      </el-row>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import UserCard from './components/UserCard'
//import Activity from './components/Activity'
import Timeline from './components/Timeline'
import Account from './components/Account'

export default {
  name: 'Profile',
  components: { UserCard, Timeline, Account },
  data () {
    return {
      user: {},
      activeTab: 'activity'
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'avatar',
      'roles'
    ])
  },
  created () {
    this.getUser()
  },
  methods: {
    getUser () {
      this.user = {
        name: this.name,
        role: this.roles.join(' | '),
        email: 'admin@test.com',
        avatar: this.avatar
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.app-container {
  //background-size: cover;
  // background-attachment: scroll;
  // width: 100%;
  // height: 100%;
  // display: flex;
  // align-items: center;
  // justify-content: center;
  // background-image: url(../../assets/background/20230708173425.jpg);

  // background-size: 100% 100%;
  // // min-height: 100%;
  // z-index: -99;
  background: url(../../assets/background/20230708173425.jpg); //这里的地址是用你项目中图片所在的路径为准
  background-repeat: no-repeat; //将图片样式不重复
  background-size: 100% 100%; //设置图片大小
  position: fixed;
  /* 充满全屏 */
  height: 100%; //设置div高度
  width: 100%; //设置div宽度

  // width: 100%;
  // background-color: $bg;
  // overflow: hidden;
  // bottom: 0%;
  // width: 100%;
  // height: 100%;
  // // background-image: url(../assets/img/bg01.png);
  // background-size: cover;
  // /* 使图片平铺满整个浏览器（从宽和高的最大需求方面来满足，会使某些部分无法显示在区域中） */
  // position: absolute;
  // /* 不可缺少 */
  // z-index: -1;
  // background-repeat: no-repeat;
}
</style>